package com.edu.compile.dto.options;

import com.alibaba.fastjson.JSON;
import com.edu.compile.dto.RequestParam;

import java.util.List;

public class OptionsParam extends RequestParam<OptionsParam> {

    /**
     * 0-固定值  1-来自节点
     */
    private Integer source;

    /**
     * 0-数值型（默认） 1-布尔型 2-字符串 3-时间型
     */
    private Integer sourceType;

    /**
     * 1/<id@key>
     */
    private String sourceValue;

    private List<OptionsTargetParam> targets;


    public Integer getSource() {
        return source;
    }

    public void setSource(Integer source) {
        this.source = source;
    }

    public String getSourceValue() {
        return sourceValue;
    }

    public void setSourceValue(String sourceValue) {
        this.sourceValue = sourceValue;
    }

    public Integer getSourceType() {
        return sourceType;
    }

    public void setSourceType(Integer sourceType) {
        this.sourceType = sourceType;
    }

    public List<OptionsTargetParam> getTargets() {
        return targets;
    }

    public void setTargets(List<OptionsTargetParam> targets) {
        this.targets = targets;
    }

    public OptionsParam() {
    }

    @Override
    public OptionsParam parse(String requestParam) {
        OptionsParam optionsParam = JSON.parseObject(requestParam, OptionsParam.class);
        return optionsParam;
    }
}
